INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/Log)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/mutex)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/Str)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/DB)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/DB/sqlite)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/Serial)

AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/Log LOG_DIR_SRCS)
AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/mutex MUX_DIR_SRCS)
AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/Str STR_DIR_SRCS)
AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/DB DB_DIR_SRCS)
AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/DB/sqlite SQLITE_DIR_SRCS)
AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/jsoncpp JSON_DIR_SRCS)
AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/Serial COM_DIR_SRCS)

AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR} DIR_SRCS)

SET(UTIL_SRC ${DIR_SRCS} ${LOG_DIR_SRCS} ${MUX_DIR_SRCS} ${DB_DIR_SRCS} ${SQLITE_DIR_SRCS} ${JSON_DIR_SRCS} ${STR_DIR_SRCS} ${COM_DIR_SRCS})

ADD_LIBRARY(Util
            SHARED
            ${UTIL_SRC})

target_link_libraries(Util log)